<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" import="java.util.*,com.fxy.entity.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>主页</title>
</head>
<body>
	<h1>主页</h1>
	欢迎你:<%=session.getAttribute("userName")%>
	<a href="LogoutServlet">退出登录</a>
	<a href="login.jsp">登录</a>
	<br />

	<br />
	<h2>菜单</h2>
	<a href="2.jsp">2页面</a>
	<a href="3.jsp">3页面</a>


	<h2>展示商品列表</h2>
	<table width="300" border="1">
		<tr>
			<td>id</td>
			<td>名字</td>
			<td>价格</td>
			<td>库存</td>
		</tr>

		<%
			if (request.getAttribute("proList") != null) {
				ArrayList<Product> list = (ArrayList<Product>) request.getAttribute("proList");
				for (Product p : list) {
		%>
		<tr>
			<td><%=p.getProId()%></td>
			<td><%=p.getProName()%></td>
			<td><%=p.getProPrice()%></td>
			<td><%=p.getProNum()%></td>
		</tr>
		<%
			}
			}
		%>

	</table>
</body>
</html>